Component({
    externalClasses: ["mit-class"],
    properties: {active: {type: Boolean, value: !1}, activeLeft: {type: Number, value: 0}},
    data: {brandColor: "", translation: 0, activeLeft: 0},
    relations: {
        "../Tabs/index": {
            type: "parent", linked(e) {
                e.properties.brandColor && this.setData({brandColor: e.properties.brandColor})
            }
        }
    },
    ready() {
        wx.createSelectorQuery().in(this).select(".mit-tabs-cell-bottom").boundingClientRect(e => {
            this.setData({nodeLeft: e.left})
        }).exec()
    },
    methods: {
        change_tab(e) {
            let t = this.getRelationNodes("../Tabs/index");
            if (t.length) {
                let e = t[0].getRelationNodes("../TabsCell/index");
                e.forEach(e => {
                    e.properties.active && e.setData({active: !1})
                }), this.setData({active: !0}), e.forEach(e => {
                    e.setData({activeLeft: this.data.nodeLeft})
                })
            } else console.error("Error tabs cell parent, Tabs-Cell does not has a Tabs parent")
        }
    },
    get_active(e) {
        console.log(e)
    }
});